<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.7.1.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				$(".add").click(function(){
					let div=$("<div></div>")
					let file=$("<input type='file'>")
					let del=$('<button type="button" class="del">删除</button>')
					$(document).on("click",".del",fun)//给整个网页文档做动态绑定
					div.append(file)
					div.append(del)
					$(".con").append(div)
				})
			})
			//删除多余的按钮组件
			function fun(){
				$(event.target.parentNode).remove()
			}
		</script>
	</head>
	<body>
		请选择你要上传的文件
		<div>
			<input type="file"/>
				<button type="button" class="add">增加</button>
		</div>
		<div class="con">
			
		</div>
	</body>
</html>
